package com.ftcs.context;

import lombok.Getter;
import lombok.Setter;

/**
 * @author changhuafeng
 * @version V1.0.0
 * @since 2019/3/6
 */
public enum PermissionEnum {
	HR_AUDIT(1, "人事审批"), HR_AUDIT2(2, "出纳付款"), HR_AUDIT3(3, "总经理审批"), HR_AUDIT4(4, "财务审批"), DEPT_AUDIT(5,
			"部门领导审批"), HR_AUDIT5(6, "采购审批");

	@Getter
	@Setter
	private Integer code;
	@Getter
	@Setter
	private String desc;

	PermissionEnum(Integer code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static String getPermissionName(Integer code) {
		PermissionEnum[] enums = PermissionEnum.values();
		for (PermissionEnum colorEnum : enums) {
			if (colorEnum.getCode().equals(code)) {
				return colorEnum.getDesc();
			}
		}
		return "";
	}

	public static void main(String[] args) {
		System.out.println(getPermissionName(1));
	}
}
